package cloud.seckill.seckillserver.service.impl;

import cloud.seckill.seckillserver.common.redis.RedisUtil;
import cloud.seckill.seckillserver.service.RedisService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import static cloud.seckill.seckillserver.common.constant.RedisConstant.GOODS_KEY;

/**
 * @title: RedisServiceImpl
 * @Author Wangsj
 * @Date: 2021/5/24
 */
@Slf4j
@Service
public class RedisServiceImpl implements RedisService {


    @Autowired
    RedisUtil redisUtil;

    @Override
    public void InitSeckill() {
        log.info("------------------- init goods num to 100");
        redisUtil.cacheValue(GOODS_KEY, 100);
        log.info("------------------- init goods num success!!");
    }
}
